package com.zuoye.signin;

import com.zuoye.extend.Common;
import com.zuoye.method.MethodDome01;

import java.util.Scanner;

import static com.zuoye.method.MethodDome01.students;

/**
 * @version v1.0
 * @Description
 * @Author admin
 * @date 2021/7/13  17:17
 * @Copyright
 */
public class SigninMethod extends Common {
    public static boolean falg =false;



    public static boolean DengLu() {
        System.out.println("请输入用户名:");
        String name = scanner.next();

        System.out.println("请输入密码:");
        String pwd = scanner.next();
        if (name.equals("admin") && pwd.equals("123456")) {
            System.out.println("欢迎使用学生管理系统");
            return falg = true;
        } else {
            System.out.println("用户名或密码错误!!!");
            return falg;
        }

    }

    public static void showMenu(){
        for ( int i=0; i<=1000 ; i++) {
            System.out.println("请选择选项：1.添加学生信息，2.删除学生信息，3.修改学生信心，4.查询学生信息,5.退出系统");

            Scanner scas = new Scanner(System.in);
            int c = scas.nextInt();


            if (c == 1) {
                //添加
                MethodDome01.add( scanner);

            } else if (c == 4) {
                //查询
                MethodDome01.Chaxun(students);
            }else if (c == 2) {
                //删除
                MethodDome01.Del(scanner,students);
            }else if (c == 3) {
                //修改
                MethodDome01.update(scanner,students);

            }else if (c == 5) {
                //退出
                MethodDome01.ext();
                break;

            }else if (c >= 6 ) {
                System.out.println("没有该选项，再给你一次机会，希望你不要不中用！");
            }
        }

    }
}
